<!DOCTYPE html>
<html id="iframe">
<head>
    <meta charset="utf-8"/>

    <title>{:C('sitename')}55555</title>

    <meta name="renderer" content="webkit">
    <meta name="format-detection" content="telephone=no,email=no"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
    <meta name="telephone=no" content="format-detection">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no"/>

    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">

    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/lib.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/public.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/main.css">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Home/css/page.css"/>
    <link rel="stylesheet" href="__PUBLIC__/tables/tables.css">

</head>
<style>
    html{
        overflow-y: scroll !important;
        height: 35rem;
    }
    body {
        height: 35rem !important;
        overflow-y: scroll;
        margin: 0;
    }

    .button {
        display: inline-block;
        width: 3rem;
        height: 0.8rem;
        line-height: 0.8rem;
        font-size: 0.9rem;
        background: -webkit-linear-gradient(#818078, #292928);
        background: -o-linear-gradient(#818078, #292928);
        background: -moz-linear-gradient(#818078, #292928);
        background: linear-gradient(#818078, #292928);
    }

    .leftRight .nav, .leftRight .content {
        padding: 0 !important;
    }

    .content p {
        display: inline-block;
    }

    .keyborad {
        display: none;
        position: absolute;
        top: 33px;
        left: 0px;
        z-index: 10;
        padding: 3px;
        margin: 0 !important;
        border-radius: 6px;
        background-color: #6a6e71;
        width: 100%;
    }

    .keyborad p {
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }

    .keyborad p span {
        display: inline-block;
        width: 13%;
        height: 40px;
        line-height: 40px;
        background-color: #293039;
        color: #FFF;
        text-align: center;
        border-radius: 3px;
    }

    .keyborad strong {
        display: inline-block;
        width: 15%;
        border-radius: 3px;
        height: 40px;
        line-height: 40px;
        color: #FFF;
    }

    .keyborad .qc, .keyborad .jt, .keyborad .fs, .keyborad .close {
        border: 1px solid #ffe668;
        background-color: #262626;
    }

    .keyborad strong {
        display: inline-block;
        width: 23.5%;
        border-radius: 3px;
        height: 40px;
        line-height: 40px;
        color: #ffe668;
    }
    .tb-continer .title {
        height: 1rem;
        line-height: 1rem;
        text-align: center;
        background: #333;
        color: #fff;
    }
</style>
<body>


<!--弹窗-北京赛车-->
<link rel="stylesheet" type="text/css" href="/Template/Home/Run/css/zhicwl-z.css"/>

<style>
    .zhicwl-qiejlf-tab-04 .zhicwl-akodr dl dt {
        width: 33%;
        margin-bottom: 6px;
    }

    .zhicwl-qiejlf-tab-05 .zhicwl-akodr dl dt {
        width: 100%;
    }

    .zhicwl-qiejlf-tab-05 .zhicwl-akodr dl dt:nth-of-type(10) {
        width: 100%;
    }

    .zhicwl-qiejlf-tab-05 .zhicwl-akodr dl dt span {
        font-weight: normal;
    }

    .zhicwl-qiejlf-tab-06 .zhicwl-akodr dl dt {
        width: 20%;
    }
    .input-chatting{
        width: 100%;
        padding: 15px 12px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 9999999;
        background: #f7f7f7;
    }
    .input-chattings{
        width: 100%;
        padding: 15px 12px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        bottom: 0;
        z-index: 9999999;
        background: #f7f7f7;
    }
    .input-chatting >img{
        width: 24px;
    }
    .input-chatting input{
        flex: 1;
        height: 36px;
        border-radius: 4px;
        margin: 0 8px;
        padding: 0 9px;
        box-sizing: border-box;
    }
    .input-chatting button{
        color: #fff;
        background-color: #08c261;
        border-radius: 3px;
        border: none;
        outline: none;
        height: 28px;
        padding: 2px 18px;
        box-sizing: content-box;
    }
    .input-chattings >img{
        width: 24px;
    }
    .input-chattings input{
        flex: 1;
        height: 36px;
        border-radius: 4px;
        margin: 0 8px;
        padding: 0 9px;
        box-sizing: border-box;
    }
    .input-chattings button{
        color: #fff;
        background-color: #08c261;
        border-radius: 3px;
        border: none;
        outline: none;
        height: 28px;
        padding: 2px 18px;
        box-sizing: content-box;
    }
    .menu-ul-t{
        width: 90px;
        position: fixed;
        display: none;
        top: 56px;
        right: 12px;
        padding: 8px;
        background: #3a3737;
        opacity: 0.98;
        border-radius: 5px;
        z-index: 9999999999;
    }
    .menu-ul{
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .menu-ul dd{
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: center;
        padding: 4px 0;
    }
    .menu-ul dd>a{
        width: 100%;
        display: flex;
        align-items: center;
        box-sizing: border-box;
    }
    .menu-ul a > img{
        width: 15px;
        box-sizing: content-box;
        padding-right: 10px;
    }
    .menu-ul a p{
        flex: 1;
        padding: 0 0 6px 0.6rem;
        box-sizing: border-box;
        color: #fff;
        font-size: 13px;
        letter-spacing: 5px;
        border-bottom: 1px solid #e7e7e7;
    }
    .white_content, .white_content1, .white_content2, .white_content3, .white_content4 {
        position: absolute;
        bottom: 0;
        width: 100vw;
        height: 60vh;
        bottom: -100vh;
        left: 0;
        background-color: #fff;
        z-index: -1002111111;
        overflow: auto;
        border-radius: 6px 6px 0 0;
        opacity: 0;

    }
    .active-white{
        position: fixed;
        width: 100vw;
        height: 60vh;
        bottom: 0;
        left: 0;
        z-index: 1002111111;
        opacity: 1;
        transition: all 0.72s ease-in-out;
    }

    .close, .close1, .close2, .close3, .close4 {
        display: none;
        width: 0.88rem;
        height: 2.09rem;
        position: fixed;
        left: 50%;
        bottom: 59.3%;
        z-index: 111111111111;
        transform: translate(-0.44rem);
    }

    /*#light > p, #light1 > p, #light2 > p, #light3 > p, #light4 > p {
        width: 10rem;
        margin: 0;
        height: 1.06rem;
        position: fixed;
        background-color: #262626;
        bottom: calc(60% - 1.06rem);
        z-index: 10021111111;
        border-bottom: 1px solid #67603a;
        text-align: center;
        line-height: 1.06rem;
        font-size: 0.546rem;
        color: #ffe668;
    }*/
    .header-light{
        display: flex;
        align-items: center;
        color: #333;
        padding: 8px 16px;
    }
    .header-light p{
        flex: 1;
        font-size: 14px;
        text-align: center;
    }
    .header-light img{
        width: 18px;
    }
    .footer-info {
        width: 100%;
        height: 100vh;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(0, 0, 0, 0.16);
        z-index: 999999999999999999;
        display: none;
        font-size: 0.346rem;
        color: #000;
    }
    .fotter-box{
        width: 64%;
        display: flex;
        flex-flow: column nowrap;
        justify-content: center;
        padding: 24px 12px;
        background: #fff;
        border-radius: 6px;
        transform: translateY(-50%);
        margin: 50vh auto;
    }
    .header-box{
        display: flex;
        align-items: center;
        padding-bottom: 24px;
    }
    .header-box >h3{
        font-size: 15px;
        flex: 1;
        text-align: center;
    }
    .header-box img{
        width: 18px;
    }
    .fotter-box p{
        padding: 8px 0;
        text-align: center;
        font-size: 13px;
    }
</style>
<body>
<div class="zhicwl-csplr" style="padding-bottom:25px;position: fixed;top: 0;z-index: 99999999999999999999; height: 30rem;padding-top: 18px">

    <div class="zhicwl-yrlof" style="margin:0 auto; display: none;">
        <div class="zhicwl-arwort">
            <div class="zhicwl-arwort-div">
                <dl class="zhicwl-tc-01 display-box box-align-center">
                    <dt class="on"><span>猜庄闲</span></dt>
                </dl>
            </div>
        </div>
    </div>


    <section class="zhicwl-qiejlf">
        <!--猜庄闲-->
        <div class="zhicwl-qiejlf-tab zhicwl-qiejlf-tab-04" style="background: #fff;">
            <div class="zhicwl-ldprta display-box box-align-center" style="margin-top:0;">
                <h2 class="zhicwl-ldprta-left box-flex" style="padding-top:0.9rem;">猜庄闲和</h2>
                <div class="zhicwl-repavb zhicwl-guanb">
                    <img src="__PUBLIC__/Home/img/backIcon.png" alt="" style="position: relative;top:0.7rem;">
                </div>
            </div>

            <div class="zhicwl-keapr">
                <div class="zhicwl-akodr">
                    <dl>
                        <dt>
                            <div>
                                <span data="庄">banker</span>
                                <samp>x {:C('hundred_z_point')}</samp>
                            </div>
                        </dt>
                        <dt>
                            <div>
                                <span data="和">tie</span>
                                <samp>x {:C('hundred_h_point')}</samp>
                            </div>
                        </dt>
                        <dt>
                            <div>
                                <span data="闲">player</span>
                                <samp>x {:C('hundred_x_point')}</samp>
                            </div>
                        </dt>

                        <dt style="width:50%;">
                            <div>
                                <span data="庄对">B pair</span>
                                <samp>x {:C('hundred_zxd_point')}</samp>
                            </div>
                        </dt>
                        <dt style="width:50%;">
                            <div>
                                <span data="闲对">P pair</span>
                                <samp>x {:C('hundred_zxd_point')}</samp>
                            </div>
                        </dt>

<!--                        <dt style="width:50%;">-->
<!--                            <div>-->
<!--                                <span>三宝</span>-->
<!--                            </div>-->
<!--                        </dt>-->
<!--                        <dt style="width:50%;">-->
<!--                            <div>-->
<!--                                <span>对子</span>-->
<!--                            </div>-->
<!--                        </dt>-->
                    </dl>
                </div>
            </div>
        </div>
        <!--/猜庄闲-->

    </section>

</div>
<!--/弹窗-北京赛车-->

<div id="input-chatting">
    <img class="zhicwl-xiaz" src="__PUBLIC__/Home/img/binding.png" alt="">
    <input type="text" name="" id="textarea">
    <button id="postDataOk">send</button>
    <button id="selectMenu" style="background: #7181e8;margin-left: 9px;">more</button>
</div>
<div id="menu-ul-t" class="menu-ul-t">
    <dl class="menu-ul">
        <!-- <dd>
            <a href="/Home/User/index">
                <img src="__PUBLIC__/Home/img/menuList4.png" alt="">
                <p>我的</p>
            </a>
        </dd>
        <dd>
            <a href="/Home/Run/index">
                <img src="__PUBLIC__/Home/img/menuList1.png" alt="">
                <p>大厅</p>
            </a>
        </dd>
        <dd>
            <a href="{:U('Home/Fen/addpage')}?type=pk10">
                <img src="__PUBLIC__/Home/img/menuList2.png" alt="">
                <p>充值</p>
            </a>
        </dd>
        <dd>
            <a href="{:U('Home/Fen/xiapage')}?type=pk10">
                <img src="__PUBLIC__/Home/img/menuList3.png" alt="">
                <p>提现</p>
            </a>
        </dd> -->
        <dd>
            <a href="javascript:void(0)" onclick="openRecord()">
                <img src="__PUBLIC__/Home/img/menuList3.png" alt="">
                <p>Note</p>
            </a>
        </dd>
        <dd>
            <a href="javascript:void(0)"onclick="openKjssc()">
                <img src="__PUBLIC__/Home/img/menuList4.png" alt="">
                <p>record</p>
            </a>
        </dd>
        <dd>
            <a href="javascript:void(0)" onclick="openRule()">
                <img src="__PUBLIC__/Home/img/menuList2.png" alt="">
                <p>rule</p>
            </a>
        </dd>
        <dd>
            <a href="javascript:void(0)" id="lastmenu">
                <img src="__PUBLIC__/Home/img/menuList4.png" alt="">
                <p>Balance</p>
            </a>
        </dd>
    </dl>
</div>
<div id="light1" class="white_content1">
    <div class="header-light">
        <p>Notes</p>
        <img src="__PUBLIC__/Home/img/backIcon.png" onclick="closeRecord()" alt="">
    </div>
    <table class="tb-continer" style="margin-top:0.28rem;">
        <thead>
        <tr class="title">
            <th>income:  <span id="jin">0</span></th>
            <th>OutItem:  <span id="chu">0</span></th>
            <th>lose/win:  <span id="ying">0</span></th>
        </tr>
        </thead>
    </table>
    <table class="tb-continer">
        <thead>
        <tr class="title">
            <th>Bet options</th>
            <th>Bet amount</th>
            <th>periods</th>
            <th>result</th>
        </tr>
        </thead>
        <tbody id="danzhuList">

        </tbody>
    </table>
</div>
<div id="light2" class="white_content2">
    <div class="header-light">
        <p>Lottery record</p>
        <img src="__PUBLIC__/Home/img/backIcon.png" onclick="closeKjssc()" alt="">
    </div>
    <div class="kjssc_wrapper" style="margin-top:0.28rem;">
        <div class="tab-content">
            <div id="app1"></div>
        </div>
    </div>
</div>
<div id="light3" class="white_content3">
    <div class="header-light">
        <p>Rules of the game</p>
        <img src="__PUBLIC__/Home/img/backIcon.png" onclick="closeRule()" alt="">
    </div>
    <div class="sscrule" style="color:#333;padding:0 0.3rem; margin-top:0.28rem;">
        <br>
        <div class="">
            <h4 class="cl-orange" style="font-size:0.4rem; color:#333;">【Baccarat game introduction】</h4><br>
            <p>Baccarat, English for baccarat, means "0" in Italian, originated from a card game in France and popular in casinos all over Europe. In the 20th century, baccarat was introduced into Macao from the United States by Mr. Ye Han, and Baccarat was named baccarat with Oriental color. Today, baccarat is one of the most popular gambling games in casinos around the world. Among the casinos in Macao, the number of baccarat tables is the largest in the world。<br/>
        </div>
        <br>

    </div>
    <div class="">
            <h4 class="cl-orange" style="font-size:0.4rem; color:#333;">【Basic play】</h4><br>
            <p>
                Use 3-8 pairs of cards, 52 cards in each pair, shuffle them together, put them in the licensing box, and distribute them by the charging officer. Each family strives to have two or three cards in their hands. The total points are 9 or close to 9. K, Q, J and 10 are all counted as 0. Other cards are counted according to the cards. In the calculation, the card values in each player's hands are added, but only the last digit is discussed. The one who pays the most money on the spot is the banker.
                According to their own ideas, guests can choose Zhuang, Xian, he and Duzi or any other bet。
            </p>
        </div>
        <br>
        <div class="">
            <h5 class="cl-blue" style="font-size:0.4rem; color:#333;">
                【Licensing and licensing】

            </h5><br>
            <p>Baccarat generally uses 8 pairs of cards, which are put in the distribution box after shuffling. Both sides will receive at least two cards, but no more than three. The first and third cards are issued to "leisure house", while the second and fourth cards are issued to "dealer". Whether or not to bid is determined according to the licensing rules (or licensing rules). Baccarat is different from 21 points. Players can bet on bank or player without restriction。<br>
            </p>
            <br>
            <h5 class="cl-blue" style="font-size:0.4rem; color:#333;">
                【Calculation method of points】

            </h5><br>
            <p>In baccarat, ACE's playing cards are counted as one point; cards from two to nine are counted according to the number of points shown; and cards of 10, J, Q and K are counted as zero points (some casinos count on 10 points). When the total points of all cards exceed 9, only the bits in the total are counted. Therefore, the size of an 8 and a 9 is: 7 points (8 + 9 = 17). Baccarat is also called baccarat (for example, a 10 and a Q: 10 + 10 = 20, only counting a bit is 0)。<br>
            </p>
            <br>

        </div>

        <h5 class="cl-blue" style="font-size:0.4rem; color:#333;">
            【Game odds】
        </h5>
        <br>
        <p>
            ■Odds：<br />
            <small>
                Banker，Including the original{:C('hundred_z_point')}times<br />
                Player，Including the original{:C('hundred_x_point')}times<br />
                Tie，Including the original{:C('hundred_h_point')}times<br />
                B Pair，Including the original{:C('hundred_zxd_point')}times<br />
                P Pair，Including the original{:C('hundred_zxd_point')}times<br />
            </small>
            ■Banker Quota：{:C('hundred_z_money')}<br />
            ■Player Quota：{:C('hundred_x_money')}<br />
            ■Tie Quota：{:C('hundred_h_money')}<br/>
            ■B Pair/P Pair Including the original：{:C('hundred_zxd_money')}(Total item limit )<br />
        </p>


        <br>

        <!--<br> <h4 class="cl-orange" style="font-size:0.4rem; color:#fff98d;">每期下注：总额{:C('hundred_max_money')}封顶</h4><br>-->
        <h4 class="cl-orange" style="font-size:0.4rem; color:#333;">【explain】</h4><br>
        <p>
            <!-- ■没带名次默认投第一名，如「双/100」第一名双$100、「123/100」第一名123号各$100<br /> -->
            ■There may be a delay of 1-2 seconds due to the uncertain network quality in different places. The system will determine whether the bet is successful or not。<br />

        </p>
    </div>

</div><div class="footer-info" id="footer-info">
    <div class="fotter-box">
        <div class="header-box">
            <h3>Account Balance</h3>
            <img src="__PUBLIC__/Home/img/backIcon.png" id="clouse-footer" alt="">
        </div>
        <p>Balance：<span class="money">{$userinfo.points}</span></p>
        <p>Account：<span class="Name">{$userinfo.nickname}</span></p>
    </div>
</div>
<div class="main-box">
    <!--第一行（表单、积分在线人数）-->
    <div class="top"
         style="width:100%;height:18px;background-color:rgb(237, 237, 237);position: fixed;top:0;z-index:9999;">
        <div class="keyborad">
            <p>
                <span>1</span>
                <span>2</span>
                <span>3</span>
                <span>4</span>
                <span>5</span>
                <span>/</span>
            </p>
            <p>
                <span>6</span>
                <span>7</span>
                <span>8</span>
                <span>9</span>
                <span>0</span>
            </p>
            <p>
                <span>庄</span>
                <span>闲</span>
                <span>和</span>
                <span>庄对</span>
                <span>闲对</span>
            </p>
            <p>
                <strong class="qc">delete</strong>
                <strong class="jt">←</strong>
                <strong class="fs">send</strong>
                <strong class="close">close</strong>
            </p>
        </div>
    </div>
</div>

<div id="load" style="text-align: center;font-size: 14px;color:#fff;">loading...</div>
<div class="chatting" style="display: none;margin-bottom:25rem !important;padding-top: 4.8rem;overflow-y: scroll;">
    <volist name="list" id="vo">

        <if condition="$vo['type'] eq 'admin'">
            <div class="chatting-li qtr orange">
            <!--class="chatting-li qtr orange"-->
                <div class="portrait"><img src="{$vo.head_img_url}"/></div>
                <div class="content">
                    <small><span class="name">{$vo.from_client_name}</span>
                        <time>{$vo.time}</time>
                    </small>
                    <p>{$vo.content|htmlspecialchars_decode|stripcslashes}</p>

                </div>
            </div>
        </if>
        <if condition="$vo['type'] eq 'system'">
            <div class="chatting-li qtr pink">
                <div class="portrait"><img src="{$vo.head_img_url}"/></div>
                <div class="content">
                    <small><span class="name">{$vo.from_client_name}</span>
                        <time>{$vo.time}</time>
                    </small>
                    <p>{$vo.content|htmlspecialchars_decode|stripcslashes}</p>

                </div>
            </div>
        </if>
        <if condition="$vo['type'] eq 'say'">
            <div class="chatting-li">
                <div class="portrait"><img src="{$vo.head_img_url}"/></div>
                <div class="content">
                    <small><span class="name">{$vo.from_client_name}</span>
                        <time>{$vo.time}</time>
                    </small>
                    <p>{$vo.content|htmlspecialchars_decode|stripcslashes}</p>

                </div>
            </div>
        </if>
        <if condition="$vo['type'] eq 'error' && $userinfo['id'] eq $vo['uid']">
            <div class="chatting-li qtr green">
                <div class="portrait"><img src="{$vo.head_img_url}"/></div>
                <div class="content">
                    <small><span class="name">{$vo.from_client_name}</span>
                        <time>{$vo.time}</time>
                    </small>
                    <p>{$vo.content|htmlspecialchars_decode|stripcslashes}</p>

                </div>
            </div>
        </if>
        <if condition="$vo['type'] eq 'say_error' && $userinfo['id'] eq $vo['uid']">
            <div class="chatting-li">
                <div class="portrait"><img src="{$vo.head_img_url}"/></div>
                <div class="content">
                    <small><span class="name">{$vo.from_client_name}</span>
                        <time>{$vo.time}</time>
                    </small>
                    <p>{$vo.content|htmlspecialchars_decode|stripcslashes}</p>

                </div>
            </div>
        </if>
</volist>
</div>
<!--<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>-->
<script src="__PUBLIC__/Home/js/jquery.min.js"></script>
<!--聊天-->
<script type="text/javascript" src="__PUBLIC__/worker/js/swfobject.js"></script>
<script type="text/javascript" src="__PUBLIC__/worker/js/web_socket.js"></script>
<script src="__PUBLIC__/tables/tables.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
    var ua = window.navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == 'micromessenger') {
        //在微信中打开需要的操作
        $('#input-chatting').removeClass('input-chatting').addClass('input-chattings')
        $('#menu-ul-t').attr('style','bottom:56px;top: auto;')
    } else {
    //不在微信中打开
       $('#input-chatting').removeClass('input-chattings').addClass('input-chatting')
    }
    function openRecord() {
        //获取数据
        $.post('/Home/Run/hundredRecord',{
            game:'hundred',
            page:0
        },function(e){
            var con=eval('('+e+')').content;
            var con_zhongji=eval('('+e+')').zongji;
            var str='';
            con.forEach((it)=>{
                if(it.type.indexOf('/')!=-1){
                    var sp=it.type.split('/');
                    var spa=it.points.split('/');
                    for(let i=0;i<sp.length;i++){
                        str+=` <tr class="${it.odds_points>0?'yin':'shu'}"><td>${sp[i]}</td><td>${spa[i]}</td><td>${it.number}</td><td>${it.is_add==="0"?'未结算':it.odds_points>0?'赢':it.odds_points<0?'输':'退回'}</td></tr>`
                    }
                }else{
                    str+=`<tr class="${it.odds_points>0?'yin':'shu'}">
                            <td>${it.type}</td>
                            <td>${it.points}</td>
                            <td>${it.number}</td>
                            <td>${it.is_add==="0"?'Unsettled':it.odds_points>0?it.odds_points:it.odds_points<0?it.odds_points:'return'}</td>
                           </tr>`
                }
            });
            document.querySelector('#danzhuList').innerHTML=str;
            document.querySelector('#jin').innerHTML=eval('('+e+')')['zongji']['jin'];
            document.querySelector('#chu').innerHTML=eval('('+e+')')['zongji']['chu'];
            document.querySelector('#ying').innerHTML=eval('('+e+')')['zongji']['ying'];
            document.getElementById('light1').classList.add('active-white');
            document.getElementById('fade1').style.display = 'block';
        });
    }

    function closeRecord() {
        document.getElementById('light1').classList.remove('active-white');
        // document.getElementById('light1').style.display = 'none';
        document.getElementById('fade1').style.display = 'none';
    }

    function openKjssc() {
        $.post('/Home/Run/kjhundred',[],function(e){
            var tb=new Tables('#app1',6);
            var list=eval('('+e+')').content;
            for(let i=0;i<list.length;i++){
                let it=list[i];
                let h=Math.floor(i%6+1);
                let l=Math.floor(i/6+1);
                let as=it.award_numbers.split(',');
                as.forEach((at)=>{
                    switch(at){
                        case '庄':
                            tb.addZ(h,l);
                            break;
                        case '闲':
                            tb.addX(h,l);
                            break;
                        case '和':
                            tb.addH(h,l);
                            break;
                        case '庄对':
                            tb.addZd(h,l);
                            break;
                        case '闲对':
                            tb.addXd(h,l);
                            break;
                    }
                })
            }

            document.getElementById('light2').classList.add('active-white');
            document.getElementById('fade2').style.display = 'block';
        });
    }

    function closeKjssc() {
        document.getElementById('light2').classList.remove('active-white');
        document.getElementById('fade2').style.display = 'none';
    }

    function openRule() {
        document.getElementById('light3').classList.add('active-white');
        document.getElementById('fade3').style.display = 'block';
    }

    function closeRule() {
        document.getElementById('light3').classList.remove('active-white');
        document.getElementById('fade3').style.display = 'none';
    }
    $('#lastmenu').click(function(){
        $('#footer-info').toggle()
    })
    $('#clouse-footer').click(function(){
        $('#footer-info').hide()
    })
    $("#selectMenu").click(function(){
        $("#menu-ul-t").slideToggle()
        return false
    })
    $(document).click(function(){
        $("#menu-ul-t").hide()
    })
    setTimeout(function () {
        $('#load').css('display', 'none');
        $('.chatting').css('display', 'block');
    }, 1500);
    $('.jp_btn').click(function () {
        if ($('.keyborad').is(":hidden")) {
            $('.keyborad').show();
        } else {
            $('.keyborad').hide();
        }

    })

    $('.keyborad span').click(function () {
        var value = $(this).text();
        var input_value = $('#textarea').val();
        $('#textarea').val(input_value + value);
    })

    $('.keyborad .qc').click(function () {
        $('#textarea').val('');
    })

    $('.keyborad .jt').click(function () {
        var input_value = $('#textarea').val();
        var str = input_value.substr(0, input_value.length - 1);
        $('#textarea').val(str);
    })

    $('.keyborad .fs').click(function () {
        $('.submit_btn').click();
        $('.keyborad').hide();
    })

    $('.keyborad .close').click(function () {
        $('.keyborad').hide();
    })

    $('.submit_btn').click(function () {
        $('.keyborad').hide();
    })
    // $('#textarea').blur(function(){
    // 	$('.keyborad').hide();
    // })


    document.onkeydown = function (event) {
        e = event ? event : (window.event ? window.event : null);
        if (e.keyCode == 13) {
            onSubmit();
            return false;
        }
    }
    $('#postDataOk').click(onSubmit);

    if (typeof console == "undefined") {
        this.console = {
            log: function (msg) {
            }
        };
    }
    WEB_SOCKET_SWF_LOCATION = "__PUBLIC__/worker/swf/WebSocketMain.swf";
    WEB_SOCKET_DEBUG = true;
    var ws, name;

    // 连接服务端
    function connect() {
        // 创建websocket
        ws = new WebSocket("ws://" + document.domain + ":15100");
        // 当socket连接打开时，发送登录信息
        ws.onopen = function () {
            // login_data = '{"type":"pong"}';
            var name = "{$userinfo.nickname}";
            // 登录
            var userid = "{$userinfo.id}";
            var login_data = '{"type":"login","client_name":"' + name.replace(/"/g, '\\"') + '","client_id":"' + userid + '"}';
            console.log("websocket握手成功，发送登录数据:" + login_data);
            ws.send(login_data);
        };
        // 当有消息时根据消息类型显示不同信息
        ws.onmessage = onmessage;
        ws.onclose = function () {
            console.log("连接关闭，定时重连");
            connect();
        };
        ws.onerror = function () {
            console.log("出现错误");
        };
    }
    $(connect);
    var inte = parseInt(Math.random() * 12 + 1);
    function  magArr(content) {
        var strArr=[];
        try {
            var arr=eval(content);
            for(let key in arr){
                strArr.push(key+'/'+arr[key]);
            }
        }catch(e){
            strArr.push(content);
        }
        return strArr;
    }
    function maginfo(content) {
        try{
            var cont=eval("("+content+")");
        }catch (e){
            return content;
        }
        let show='';
        for(let key in cont){
            show+=key+"/"+cont[key]+" "
        }
        return show;
    }
    var money_kou=0;
    function onmessage(e) {
        var rate = 0;
        var robot_rate = e['robot_rate'] ? e['robot_rate'] : 3;
        switch (e['robot_rate']) {
            case 5:
                rate = 5;
                break;
            case 4:
                rate = 10;
                break;
            case 3:
                rate = 25;
                break;
            case 2:
                rate = 35;
                break;
            case 1:
                rate = 45;
                break;
            default:
                rate = 25;
                break;
        }
        var data = eval("(" + e.data + ")");
        // console.log(data);
        switch (data['type']) {
            // 服务端ping客户端
            case 'ping':
                $('#xs').html(data.content + {C: ('online')});
                ws.send('{"type":"pong"}');
                inte--;
                if (inte == 0) {
                    ws.send('{"type":"robot"}');
                    console.log(e.data);
                    inte = parseInt(Math.random() * rate + 1) + 2;
                }
                break;
            // 登录 更新用户列表
            case 'login':
                console.log(data['client_name'] + "登录成功");
                break;
            // 发言
            case 'say':
                say(data['uid'], data['from_client_name'], data['head_img_url'], data['content'], data['time']);
                break;
            // 用户退出 更新用户列表
            case 'logout':
                break;
            case 'broadcast':
            //alert('client');

            //房管
                case 'admin':
                var strArr=magArr(data["content"]);
                function show(){
                    if ('{$userinfo.id}' == data['uid']) {
                        strArr.forEach((it)=> {
                            $(".chatting").prepend('<div class="chatting-li qtr orange"><div class="portrait"><img src="' + data['head_img_url'] + '"/></div><div class="content"><small><span class="name">' + data["from_client_name"] + '</span><time>' + data["time"] + '</time></small><p>' + it+ '</p></div></div>');
                        });
                    } else {
                        strArr.forEach((it)=> {
                            $(".chatting").prepend('<div class="chatting-li qtr orange"><div class="portrait"><img src="' + data['head_img_url'] + '"/></div><div class="content"><small><span class="name">' + data["from_client_name"] + '</span><time>' + data["time"] + '</time></small><p>' + it + '</p></div></div>');
                        });
                    }
                }
                if(data['content'].indexOf('竞猜成功')!==-1){
                    $('.money',window.top.document).html(Number($('.money',window.top.document).html()) - money_kou);
                    money_kou=0;
                }else if(data['code']+''===''+400){
                    setTimeout(show,200);
                    break;
                }
                show();
                break;
            //系统
            case 'system':
                var strArr=magArr(data["content"]);
                if ('{$userinfo.id}' == data['uid']) {
                    strArr.forEach((it)=> {
                        $(".chatting").prepend('<div class="chatting-li qtr green"><div class="portrait"><img src="' + data['head_img_url'] + '"/></div><div class="content"><small><span class="name">' + data["from_client_name"] + '</span><time>' + data["time"] + '</time></small><p>' +it + '</p></div></div>');
                    });
                } else {
                    strArr.forEach((it)=> {
                        $(".chatting").prepend('<div class="chatting-li qtr orange"><div class="portrait"><img src="' + data['head_img_url'] + '"/></div><div class="content"><small><span class="name">' + data["from_client_name"] + '</span><time>' + data["time"] + '</time></small><p>' +it+ '</p></div></div>');
                    });
                }
                break;
            //积分减
            case 'points':
                $('#sy').html((parseFloat($('#sy').html()) - data['content']).toFixed(1));
                break;
            //积分加
            case 'pointsadd':
                $('.money',window.parent.document).html((parseFloat($('.money',window.parent.document).html()) + data['points']).toFixed(1));
                parent.layer.msg('Congratulations');
                // alert('aaaa')
                break;
            //重载
            case 'reload':
                if ('{$userinfo.id}' == 9) {
                    window.location.href = window.location.href;
                }
                break;
            //切换
            case 'switch':
                parent.location.reload();
                break;
            case 'addpoints':
                $('.money').html(data['points']);
                break;
        }
    }
    var def_content='';
    function wsTz(tz, money) {
        var headimgurl = '{$userinfo.headimgurl}';
        var from_client_name = '{$userinfo.nickname}';
        def_content=tz.replace(/5555/g, money);
        def_content=eval('('+def_content+')');
        Object.keys(def_content).forEach((e)=>{
            ws.send('{"type":"say","client_name":"' + from_client_name + '","headimgurl":"' + headimgurl + '","content":{"'+e+'":'+def_content[e]+'}}');
        });

        $('#textarea').val('');
        $(".zhicwl-qiejlf .zhicwl-qiejlf-tab .zhicwl-keapr dt").removeClass('on');
        $(".zhicwl-fxalpr-an1").removeClass('on');
    }

    function checkData() {
        var tz = [];
        var hms = "";
        //获取数据
        var fq = window.parent;
        // let list = document.querySelectorAll('.zhicwl-qiejlf-tab .zhicwl-akodr dt.on');
        let list = $('.zhicwl-qiejlf-tab .zhicwl-akodr dt.on');

        if (list != null && list.length > 0) {
            //存在
            let moneyList = {};
            list.each(function () {
                moneyList[$(this).find('span').attr('data')] = 5555;
            })
            // list.forEach((it) => {
            //     // moneyList[it.querySelector('span').innerText] = 5555;
            //     console.log(it.querySelector('span'));
            //     moneyList[it.querySelector('span').setAttribute('data')] = 5555;
            // });
            return JSON.stringify(moneyList);
        } else {
            alert("Please spend");//请投注
            return false;
        }
    }
    function GetPostData(oVal,ignoreCase=true){
        let gz={
            '庄':['Z','庄'],
            '闲':['X','闲'],
            '庄对':['ZD','庄对'],
            '闲对':['XD','闲对'],
            '和':['H','和'],
            '对子':['对子','DZ'],
            '三宝':['三宝','SB'],

        };
        let type={
            '全撤':['全撤','CQ','Q'],
            '撤庄':['撤庄','CZ'],
            '撤闲':['撤闲','CX'],
            '撤和':['撤和','CH'],
            '撤对子':['撤对子','CDZ'],
            '撤三宝':['撤三宝','CSB'],
            '撤和':['撤和','CH'],
            '梭哈庄':['梭哈庄','SHZ'],
            '梭哈闲':['梭哈闲','SHX'],
            '梭哈庄':['梭哈庄','SHZ'],
            '梭哈庄对':['梭哈庄对','SHZD'],
            '梭哈闲对':['梭哈闲对','SHXD'],
        };
        let val=oVal;
        try{
            if(ignoreCase){
                val=val.toLocaleLowerCase();
                Object.keys(gz).forEach((key)=>{
                    let obj=gz[key];
                    obj.forEach((vl,key)=>{
                        obj[key]=vl.toLocaleLowerCase();
                    })
                });
                Object.keys(type).forEach((key)=>{
                    let obj=type[key];
                    obj.forEach((vl,key)=>{
                        obj[key]=vl.toLocaleLowerCase();
                    })
                });
            }
            //优先判断是否存在type
            let typeName=null;
            Object.keys(type).forEach((key)=>{
                let obj=type[key];
                if(!typeName && obj.includes(val)){
                    typeName=key;
                }
            });
            if(typeName){
                return typeName+'/1';
            }
            let name=val.match(/[a-zA-Z\u4e00-\u9fa5]+/i)[0];
            let money=val.match(/\d+/)[0];
            let overName=null;
            Object.keys(gz).forEach((key)=>{
                let obj=gz[key];
                console.log(obj);
                if(!overName && obj.includes(name)){
                    overName=key;
                }
            });
            return overName?overName+'/'+money:oVal;
        }catch (e) {
            return oVal;
        }
    }
    // 提交对话
    function onSubmit() {
        alert('Temporary does not support(暂不支持)');
        return  false;
        var headimgurl = '{$userinfo.headimgurl}';
        var input = document.getElementById("textarea");
        var input_value = GetPostData(input.value);
        console.log(input_value);
        var from_client_name = '{$userinfo.nickname}';
        if (input.value == '') {
            $('#textarea').focus();
            return false;
        }

        let list = input_value.split('/');
        ws.send('{"type":"say","client_name":"' + from_client_name + '","headimgurl":"' + headimgurl + '","content":{"' + list[0] + '":' + list[1] + '}}');
        $('#textarea').val('');
        //$('#dialog').scrollTop(0);
    }
    // 发言
    function say(uid, from_client_name, head_img_url, content, time) {
        if(!content){
            content=def_content;
        }
        var strArr=magArr(content);
        if ('{$userinfo.id}' == uid) {
            var arr=content;
            console.log(arr);
            strArr.forEach((it)=>{
                $(".chatting").prepend('<div class="chatting-li"><div class="portrait"><img src="'+ head_img_url +'"/></div><div class="content"><small><span class="name">' + from_client_name + '</span><time>' + time +' </time></small><p>'+it+'</p></div></div>');

            })
        } else {
            strArr.forEach((it)=>{
                $(".chatting").prepend('<div class="chatting-li"><div class="portrait"><img src="' + head_img_url + '"/></div><div class="content"><small><span class="name">' + from_client_name + '</span><time>' + time + '</time></small><p>' + it + '</p></div></div>');
            })
        }
    }
</script>
<!--聊天-->

<!--推送-->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.7/socket.io.min.js"></script>-->
<script src="/Template/Home/Run/js/socket.io.min.js"></script>
<!--http://buck.msd1946.com/Template/Home/Run/js/socket.io.min.js-->
<script>
    var uid = '{$userinfo.id}';
</script>
<script>
    function escape2Html(str) {
        var arrEntities = {'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"'};
        return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) {
            return arrEntities[t];
        });
    }

    $(document).ready(function () {
        // 连接服务端
        var socket = io('http://' + document.domain + ':12223');
        // 连接后登录
        socket.on('connect', function () {
            socket.emit('login', uid);
        });
        var fpTime=null;
        var sptime=10;
        var tasm=null;
        // 后端推送来消息时
        socket.on('new_msg', function (msg) {
            var data = eval("(" + escape2Html(msg) + ")");
            if (data['type'] == '3' || data['type'] == '4' || data['type'] == '1' || data['type'] == '2') {
                return false;
            }
            if(data["clear"] && data["clear"]==="1"){
                if(data['to']){
                    if(data["to"] == '{$userinfo.id}'){
                        $('.money',window.parent.document).html(($('.money',window.parent.document).html()*1)+data["content"]*1);
                    }
                }else{
                    $('.money',window.parent.document).html(($('.money',window.parent.document).html()*1)+data["content"]*1);
                }
                return;
            }
            var time = data['time'];
            var content = data['content'];
            if (data['points'] && data['to'] == '{$userinfo.id}') {
                var points = parseFloat($('#sy').html()) + parseFloat(data['points']);
                $('#sy').html(points);
            }

            $(".chatting").prepend('<div class="chatting-li qtr pink"><div class="portrait"><img src="/Public/main/img/system.jpg"/></div><div class="content"><small><span class="name">客服</span><time>' + time + '</time></small><p>' + content + '</p></div></div>');
            if(data.content.indexOf('已封盘')!=-1){
                return;
            }
            if(data.content.indexOf('距离封盘')!=-1){
                sptime=10;
                $('#zy_loead_top',window.parent.document).show()
                clearInterval(fpTime);
                fpTime=setInterval(()=>{
                    sptime--;
                    if(sptime<=0){
                        $('#zy_loead_top',window.parent.document).hide();
                        clearInterval(fpTime);
                        return;
                    }
                    $('#zy_loead_top',window.parent.document).html(sptime)
                },1000)
            }
        });
        socket.on('new_msg26_0', function (msg) {
            var data = eval("(" + escape2Html(msg) + ")");
            if (data['type'] == '3' || data['type'] == '4' || data['type'] == '1' || data['type'] == '2') {
                return false;
            }
            if(data["clear"] && data["clear"]==="1"){
                if(data['to']){
                    if(data["to"] == '{$userinfo.id}'){
                        $('.money',window.parent.document).html(($('.money',window.parent.document).html()*1)+data["content"]*1);
                    }
                }else{
                    $('.money',window.parent.document).html(($('.money',window.parent.document).html()*1)+data["content"]*1);
                }
                return;
            }
            var time = data['time'];
            var content = data['content'];
            if (data['points'] && data['to'] == '{$userinfo.id}') {
                var points = parseFloat($('#sy').html()) + parseFloat(data['points']);
                $('#sy').html(points);
            }
            $(".chatting").prepend('<div class="chatting-li qtr pink"><div class="portrait"><img src="/Public/main/img/system.jpg"/></div><div class="content"><small><span class="name">客服</span><time>' + time + '</time></small><p>' + content + '</p></div></div>');
            if(data.content.indexOf('已封盘')!=-1){
                return;
            }
            if(data.content.indexOf('距离封盘')!=-1){
                sptime=10;
                $('#zy_loead_top',window.parent.document).show()
                clearInterval(fpTime);
                fpTime=setInterval(()=>{
                    sptime--;
                    if(sptime<=0){
                        $('#zy_loead_top',window.parent.document).hide();
                        clearInterval(fpTime);
                        return;
                    }
                    $('#zy_loead_top',window.parent.document).html(sptime)
                },1000)
            }
        });
    });
</script>
<!--推送-->
<script src="/Template/Home/Run/js/zhicwl-z.js"></script>
</body>
</html>
